//package org.ricks.net.kcp;
//
//import org.ricks.common.lang.Logger;
//import org.ricks.net.AioSession;
//import org.ricks.net.StateMachineEnum;
//import org.ricks.ioc.TaskBus;
//import org.ricks.net.handler.MessageProcessor;
//import org.ricks.net.transport.kcp.KcpSession;
//import proto.common.FProto;
//
//public class KcpHandler implements MessageProcessor<FProto> {
//
//    @Override
//    public void process(AioSession aioSession, FProto fProto) {
//
//        if(fProto.getAction() == FProto.Action.Login && fProto.getMsgCode() == 200) {
//            RobotManager.get((KcpSession) aioSession).robotId = fProto.getSelf().getPlayerId();
//        }
//
//        if(fProto.getMsgCode() == 200) {
//            Logger.info(RobotManager.get((KcpSession) aioSession).toString() + ": 收到消息模块指令:" + fProto.getAction().toString() +  " ,  请求成功 " );
//        } else {
//            Logger.info(RobotManager.get((KcpSession) aioSession).toString() + ": 收到消息模块指令:" + fProto.getAction() +  " ,  请求失败 & 状态code: " + fProto.getMsgCode()  + " , 状态信息：" + fProto.getErrorTips());
//
//        }
//
//        if(fProto.getAction() == FProto.Action.Login && fProto.getMsgCode() == 200) {
//            TaskBus.execute(aioSession, () -> RobotAction.robotStart((KcpSession) aioSession));
//        }
//
//    }
//
//    @Override
//    public void stateEvent(AioSession session, StateMachineEnum stateMachineEnum, Throwable throwable) {
//        MessageProcessor.super.stateEvent(session, stateMachineEnum, throwable);
//    }
//}
